clear
clear matrix
clear mata
program drop _all
set more off
set emptycells drop
set maxvar 100000
tempfile main
cap log close
log using Table78_full,replace

cd "<directory>"

*The code in this .do file reads in the dataset created in Data Cleaning Step 2.do and runs the regressions for Table 8 and Table 9;
*Before the estimation commands are run, the quarter of the rule change is dropped, and additional variables are created;
*The "_m" suffixes in the outreg commands stipulate which DPO window the model corresponds to:;
*	_m1 = DPO[-4,-7];
*	_m2 = DPO[-5,-8];
*	_m3 = DPO[-6,-9];
*	_m4 = DPO[-7,-10];

/*********************************************************************************
*Note: The following block of code appears before every regression. This code identifies and drops observations that Stata will automatically drop in the course of the probit estimation. This code is optional and all the regressions can be run without it. However, using this code speeds up the estimation significantly, because Stata does not have to determine whether to drop these obervations as it goes through the estimation;
*	tempfile msayq
*	keep if !missing(transfer, post, dspp0_5t8, post_dspp0_5t8, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, ssid, origyq, msayq)
*	keep if dcountss_2==1
*	keep if yearmonth>=572 & yearmonth<=620
*	collapse (mean) transfer,by(msayq)
*	gen indic=1 if transfer==0
*	keep msayq indic
*	sa `msayq',replace
*	u `main',clear
*	merge m:1 msayq using `msayq'
*	drop if _merge==2
*	drop _merge
***********************************************************************************/


u final_dataset,clear
drop if distyq==198
gen post_highlow=post*high_low 
gen treated_wl_highlow=treated_wl*high_low
sa `main',replace


u `main',clear
tempfile msayq
keep if !missing(transfer, post, cum_dpo, post_cumdpo, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, ssid, origyq, msayq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer,by(msayq)
gen indic=1 if transfer==0
keep msayq indic
sa `msayq',replace
u `main',clear
merge m:1 msayq using `msayq'
drop if _merge==2
drop _merge

 
probit transfer cum_dpo post_cumdpo orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelA, auto(2) excel replace stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)

probit transfer intxn3_cumdpo_wl cum_dpo treated_wl post_cumdpo post_treated_wl cumdpo_treated_wl orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)

probit transfer intxn3_cumdpo_dlq cum_dpo treated_dlq post_cumdpo post_treated_dlq cumdpo_treated_dlq orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)



u `main',clear
tempfile ssmsa
keep if !missing(transfer, post, cum_dpo, post_cumdpo, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, origyq, ssmsa, distyq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer,by(ssmsa)
gen indic=1 if transfer==0
keep ssmsa indic
sa `ssmsa',replace
u `main',clear
merge m:1 ssmsa using `ssmsa'
drop if _merge==2
drop _merge


probit transfer cum_dpo post_cumdpo orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)

probit transfer intxn3_cumdpo_wl cum_dpo treated_wl post_cumdpo post_treated_wl cumdpo_treated_wl orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)

probit transfer intxn3_cumdpo_dlq cum_dpo treated_dlq post_cumdpo post_treated_dlq cumdpo_treated_dlq orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)



u `main',clear
tempfile msayq
keep if !missing(transfer, post, avg_dpo_volume, post_avgvolume, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, ssid, origyq, msayq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer,by(msayq)
gen indic=1 if transfer==0
keep msayq indic
sa `msayq',replace
u `main',clear
merge m:1 msayq using `msayq'
drop if _merge==2
drop _merge

 
probit transfer avg_dpo_volume post_avgvolume orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelA, auto(2) excel replace stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)

probit transfer intxn3_avgvolume_wl avg_dpo_volume treated_wl post_avgvolume post_treated_wl avgvolume_treated_wl orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)

probit transfer intxn3_avgvolume_dlq avg_dpo_volume treated_dlq post_avgvolume post_treated_dlq avgvolume_treated_dlq orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)



u `main',clear
tempfile ssmsa
keep if !missing(transfer, post, avg_dpo_volume, post_avgvolume, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, origyq, ssmsa, distyq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer,by(ssmsa)
gen indic=1 if transfer==0
keep ssmsa indic
sa `ssmsa',replace
u `main',clear
merge m:1 ssmsa using `ssmsa'
drop if _merge==2
drop _merge


probit transfer avg_dpo_volume post_avgvolume orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)

probit transfer intxn3_avgvolume_wl avg_dpo_volume treated_wl post_avgvolume post_treated_wl avgvolume_treated_wl orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)

probit transfer intxn3_avgvolume_dlq avg_dpo_volume treated_dlq post_avgvolume post_treated_dlq avgvolume_treated_dlq orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelA, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)






u `main',clear
tempfile msayq
assert transfer==. if transfer_fullpay2==.
assert transfer_fullpay2==. if transfer==.
keep if !missing(transfer, post, cum_dpo, post_cumdpo, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, ssid, origyq, msayq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer_fullpay2,by(msayq)
gen indic=1 if transfer_fullpay2==0
keep msayq indic
sa `msayq',replace
u `main',clear
merge m:1 msayq using `msayq'
drop if _merge==2
drop _merge

probit transfer_fullpay2 cum_dpo post_cumdpo orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelB, auto(2) excel replace stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)



u `main',clear
tempfile ssmsa
keep if !missing(transfer, post, cum_dpo, post_cumdpo, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, origyq, ssmsa, distyq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer_fullpay2,by(ssmsa)
gen indic=1 if transfer_fullpay2==0
keep ssmsa indic
sa `ssmsa',replace
u `main',clear
merge m:1 ssmsa using `ssmsa'
drop if _merge==2
drop _merge

probit transfer_fullpay2 cum_dpo post_cumdpo orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelB, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)



u `main',clear
tempfile msayq
keep if !missing(transfer, post, avg_dpo_volume, post_avgvolume, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, ssid, origyq, msayq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer_fullpay2,by(msayq)
gen indic=1 if transfer_fullpay2==0
keep msayq indic
sa `msayq',replace
u `main',clear
merge m:1 msayq using `msayq'
drop if _merge==2
drop _merge

 
probit transfer_fullpay2 avg_dpo_volume post_avgvolume orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelB, auto(2) excel replace stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)


u `main',clear
tempfile ssmsa
keep if !missing(transfer, post, avg_dpo_volume, post_avgvolume, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, origyq, ssmsa, distyq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer_fullpay2,by(ssmsa)
gen indic=1 if transfer_fullpay2==0
keep ssmsa indic
sa `ssmsa',replace
u `main',clear
merge m:1 ssmsa using `ssmsa'
drop if _merge==2
drop _merge

probit transfer_fullpay2 avg_dpo_volume post_avgvolume orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelB, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)





u `main',clear
tempfile msayq
assert transfer==. if transfer_nodlq2==.
assert transfer_nodlq2==. if transfer==.
keep if !missing(transfer, post, cum_dpo, post_cumdpo, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, ssid, origyq, msayq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer_nodlq2,by(msayq)
gen indic=1 if transfer_nodlq2==0
keep msayq indic
sa `msayq',replace
u `main',clear
merge m:1 msayq using `msayq'
drop if _merge==2
drop _merge

probit transfer_nodlq2 cum_dpo post_cumdpo orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelB, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)



u `main',clear
tempfile ssmsa
keep if !missing(transfer, post, cum_dpo, post_cumdpo, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, origyq, ssmsa, distyq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer_nodlq2,by(ssmsa)
gen indic=1 if transfer_nodlq2==0
keep ssmsa indic
sa `ssmsa',replace
u `main',clear
merge m:1 ssmsa using `ssmsa'
drop if _merge==2
drop _merge

probit transfer_nodlq2 cum_dpo post_cumdpo orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table8PanelB, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)




u `main',clear
tempfile msayq
keep if !missing(transfer, post, avg_dpo_volume, post_avgvolume, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, ssid, origyq, msayq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer_nodlq2,by(msayq)
gen indic=1 if transfer_nodlq2==0
keep msayq indic
sa `msayq',replace
u `main',clear
merge m:1 msayq using `msayq'
drop if _merge==2
drop _merge

probit transfer_nodlq2 avg_dpo_volume post_avgvolume orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.ssid i.propid i.dealtypeid i.originatorid i.origyq i.msayq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelB, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)




u `main',clear
tempfile ssmsa
keep if !missing(transfer, post, avg_dpo_volume, post_avgvolume, orig_ltv, securwac, securocc, orig_dscrnoi2, age, balratio, ltv, occrate, dscrnoi, propid, dealtypeid, originatorid, origyq, ssmsa, distyq)
keep if dcountss_2==1
keep if yearmonth>=572 & yearmonth<=620
collapse (mean) transfer_nodlq2,by(ssmsa)
gen indic=1 if transfer_nodlq2==0
keep ssmsa indic
sa `ssmsa',replace
u `main',clear
merge m:1 ssmsa using `ssmsa'
drop if _merge==2
drop _merge

probit transfer_nodlq2 avg_dpo_volume post_avgvolume orig_ltv securwac securocc orig_dscrnoi2 age balratio ltv occrate dscrnoi i.propid i.dealtypeid i.originatorid i.ssmsa i.origyq i.distyq if yearmonth>=572 & yearmonth<=620 & nouse2==0 & dcountss_2==1 & indic!=1,cluster(masterloanidtrepp)
outreg2 using Table9PanelB, auto(2) excel append stats(coef se) addstat(Pseudo R2, e(r2_p)) addtext(Orig Year-Q FE, Y, Curr Year-Q FE, N, SS FE, Y, PropType FE, Y, DealType FE, Y, Originator FE, Y, MSA-Year-Q FE, Y, MSA-SS FE, N, SE Clust by loan, Y, Estimation, Probit)